package com.compomics.multidentparser.parser;

import com.compomics.multidentparser.crux.CruxParser;
import com.compomics.multidentparser.model.Content;
import com.compomics.multidentparser.model.SearchEngineType;

public class MultIdentParser {
	
	/**
	 * Generic parser instance.
	 */
	private MultIdentParser instance;
	
	/**
	 * Private constructor: singleton pattern.
	 */
	private MultIdentParser() {}
	
	/**
	 * Returns the class instance.
	 * @return The class instance.
	 */
	public MultIdentParser getInstance() {
		if(instance == null) {
			instance = new MultIdentParser();
		}
		return instance;
	}
	
	/**
	 * Returns the content of the parsed file.
	 * @param filename The filename of the file to be parsed.
	 * @param searchEngineType The search engine type.
	 * @return The content of the parsed file.
	 */
	public static Content read(String filename, SearchEngineType searchEngineType) {

		if (searchEngineType == SearchEngineType.CRUX) {
			return CruxParser.read(filename);
		}	
		else {
			return null;
		}
		
	}
	

}
